<%@page language="java" pageEncoding="UTF-8" %>
<%@page contentType="text/html; charset=utf-8" %>
<%@page import="com.mysql.jdbc.Driver" %>
<%@page import="java.sql.*"%>
<%
request.setCharacterEncoding("UTF-8");

String userName="root";
String userPassword="";
String dbName="a0713225307";

String p_id=request.getParameter("p_id");
//p_url=p_url.replace( "/","//");
//System.out.println(p_url);
	Class.forName("com.mysql.jdbc.Driver").newInstance();
	String u="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPassword+"&useUnicode=true&characterEncoding=UTF-8";
	
	java.sql.Connection connection=java.sql.DriverManager.getConnection(u,userName,userPassword);
	String sql="select * from share_db where sId="+p_id;
    Statement statement=connection.createStatement();
    ResultSet  rs=statement.executeQuery(sql);

if(rs.next()){
	System.out.println(rs.getString(5));
out.print(rs.getString(5));	
	//response.sendRedirect(rs.getString(5));
}

rs.close();
statement.close();
connection.close();
%>
